<html>
<head><meta charset="utf-8"><title>RFC Proposal · project-safe-transmute · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/index.html">project-safe-transmute</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html">RFC Proposal</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="202980503"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/202980503" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#202980503">(Jul 06 2020 at 12:10)</a>:</h4>
<p><span class="user-mention" data-user-id="219211">@Jack Wrenn</span> do you have time in the next day or so for a quick call to dicuss the RFC? I have some questions and I'd also like to help write it so maybe we can split the work up</p>



<a name="203014111"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/203014111" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Wrenn <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#203014111">(Jul 06 2020 at 16:55)</a>:</h4>
<p>Sure, are you free anytime tomorrow?</p>



<a name="203014281"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/203014281" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#203014281">(Jul 06 2020 at 16:56)</a>:</h4>
<p>Yep free until around 7pm CEST/1pm EST</p>



<a name="203018092"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/203018092" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#203018092">(Jul 06 2020 at 17:31)</a>:</h4>
<p>I'm not free until well after that but if the draft can go in a hackmd file I'd like to see it as well</p>



<a name="203022832"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/203022832" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Wrenn <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#203022832">(Jul 06 2020 at 18:14)</a>:</h4>
<p><span class="user-mention" data-user-id="224872">@Ryan Levick</span> how about we chat around 10EST?</p>



<a name="203033602"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/203033602" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#203033602">(Jul 06 2020 at 19:59)</a>:</h4>
<p>Sounds good to me! I’ll send you a zoom link in DMs</p>



<a name="203725451"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/203725451" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#203725451">(Jul 13 2020 at 14:58)</a>:</h4>
<p>I've left some comments. It's getting complete enough that I think we can move it into the repo soon for wider commenting</p>



<a name="203726302"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/203726302" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Wrenn <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#203726302">(Jul 13 2020 at 15:04)</a>:</h4>
<p>Thank you so much!  Can you clarify this comment:</p>
<blockquote>
<p>Are we missing a discussion on ABI? The reason #[repr(transparent)] exists is that some types with the same layout may have different ABIs. </p>
</blockquote>
<p>Going into the nitty-gritty of all the different <code>repr</code> annotations is out-of-scope of this RFC, but the following <em>Well-Defined Representation</em> sub-section attempts to capture the sentiment that the ABI needs to be well-defined.</p>



<a name="203735327"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/203735327" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#203735327">(Jul 13 2020 at 16:13)</a>:</h4>
<p>I just mean that you go into some detail about layout without mentioning ABI but ABI is also a concern. Types must have the same ABIs to be transmutable</p>



<a name="203738112"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/203738112" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Wrenn <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#203738112">(Jul 13 2020 at 16:38)</a>:</h4>
<p>ABI is more about calling convention than layout. To <a href="https://gankra.github.io/blah/rust-layouts-and-abis/#abi">quote Alexis Beingessner</a>:</p>
<blockquote>
<p>The layout of a type is enough to do anything you want to do with a type within Rust, but it's insufficient for full communication with C.  </p>
</blockquote>
<p>Although transmutation is often useful in FFI, it's an operation inside Rust. Only the layouts must be compatible. This includes types that aren't <code>repr(C)</code>. For instance, the layout of option-like default-repr enums is well-defined (to the extent that the inner type is well-defined, too).</p>
<p>(A caveat to all this might be transmutations involving function pointers, but I don't know if anybody's attempted to define the validity rules there.)</p>



<a name="203739307"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/203739307" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#203739307">(Jul 13 2020 at 16:50)</a>:</h4>
<p><span class="user-mention" data-user-id="219211">@Jack Wrenn</span> I'm also confused about the phase 1 proposal. You list 4 things that need to be stabilized, but I have the feeling you actually mean more needs to be stabalized.</p>



<a name="203739487"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/203739487" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Wrenn <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#203739487">(Jul 13 2020 at 16:52)</a>:</h4>
<p>For using/implementing <code>FromBytes</code>, <code>IntoBytes</code> and <code>FromZeros</code>, I believe that only those traits and <code>NeglectStability</code> need to be stabilized.</p>



<a name="203739688"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/203739688" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#203739688">(Jul 13 2020 at 16:54)</a>:</h4>
<p>Do the option traits need to be stabalized as well?</p>



<a name="203739764"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/203739764" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#203739764">(Jul 13 2020 at 16:54)</a>:</h4>
<p>I'm having a hard time following that part of the RFC</p>



<a name="203739960"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/203739960" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Wrenn <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#203739960">(Jul 13 2020 at 16:56)</a>:</h4>
<blockquote>
<p>Ryan Levick: Do the option traits need to be stabalized as well?</p>
</blockquote>
<p>No, per the RFC:</p>
<blockquote>
<p>For building truly general abstractions over <code>TransmuteFrom</code> and <code>TransmuteInto</code> (such as <code>FromZeros</code>) it is necessary to stabilize <code>UnsafeTransmuteOptions</code> and <code>SafeTransmuteOptions</code>.</p>
</blockquote>
<p>The <code>Options</code> traits only need to be stabilized if people are going to be referring to them. That's not necessary for manual implementations of <code>FromBytes</code>, <code>IntoBytes</code> and <code>FromZeros</code>.</p>



<a name="203740969"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/203740969" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Wrenn <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#203740969">(Jul 13 2020 at 17:03)</a>:</h4>
<p>The mem-marker part of the RFC has definitely received a little less attention at the moment. Personally, I'm a little iffy on whether the benefits of <code>FromBytes</code>, <code>IntoBytes</code> and <code>FromZeros</code> in libcore justify the complexity of articulating multi-stage roll-out plan. I'm not totally sold that these traits couldn't live in crates, particularly since <code>#[marker]</code> is close to stabilization.</p>



<a name="203741265"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/203741265" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#203741265">(Jul 13 2020 at 17:05)</a>:</h4>
<p>Marker traits are easier to reason about then transmute bounds IMO. I think the existence and popularity of zerocopy shows that FromBytes, IntoBytes is used enough to merit inclusion.</p>



<a name="203742311"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/203742311" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Wrenn <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#203742311">(Jul 13 2020 at 17:14)</a>:</h4>
<p>That's fair. I guess I'm not sure whether the described multi-stage roll-out is strictly necessary, then. If we remove the hypothetical period where you're supposed to manually implement these traits, then the design of them can get quite a bit nicer.</p>
<p>These traits are annotated with <code>#[marker]</code> to support manual implementations (because there's already blanket impl on them in libcore). If they weren't annotated with <code>#[marker]</code>, we could add methods to them; e.g.:</p>
<div class="codehilite"><pre><span></span><code><span class="k">pub</span><span class="w"> </span><span class="k">unsafe</span><span class="w"> </span><span class="k">trait</span><span class="w"> </span><span class="n">FromZeros</span><span class="o">&lt;</span><span class="n">Options</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">()</span><span class="o">&gt;</span><span class="w"></span>
<span class="k">where</span><span class="w"></span>
<span class="w">    </span><span class="n">Options</span>: <span class="nc">UnsafeTransmuteOptions</span><span class="w"></span>
<span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="k">fn</span> <span class="nf">zeroed</span><span class="p">()</span><span class="w"> </span>-&gt; <span class="nc">Self</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">        </span><span class="k">unsafe</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="n">mem</span>::<span class="n">zeroed</span><span class="p">()</span><span class="w"> </span><span class="p">}</span><span class="w"></span>
<span class="w">    </span><span class="p">}</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>


<p>Annotating these traits with <code>#[marker]</code> forever closes that door, unfortunately.</p>



<a name="203742665"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/203742665" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#203742665">(Jul 13 2020 at 17:16)</a>:</h4>
<p>The point of the multi-stage rollout was to simplify, but if that's not achievable without changing the nature of the RFC then we don't have to do it.</p>



<a name="203742751"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/203742751" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#203742751">(Jul 13 2020 at 17:17)</a>:</h4>
<p>There is just a fair amount of mechanisms under proposal here so having a mutli-stage rollout could help fine tune the proposal as we can experience with it. But you could argue that we just leave it under a nightly flag and fine tune it that way.</p>



<a name="203743497"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/203743497" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Wrenn <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#203743497">(Jul 13 2020 at 17:23)</a>:</h4>
<p>Yeah, I imagine that <code>TransmuteFrom</code> will start simple, and gradually handle more cases. Same with the various transmute options: those are defined in a way where they can be introduced &amp; stabilized independently from each other. <code>FromBytes</code> and company could also be stabilized independently from <code>TransmuteFrom</code> (provided that the stability declaration traits were also stabilized, too).</p>
<p>The multi-stage approach basically just enabled a period where <code>TransmuteFrom</code> could be <em>totally</em> useless, but where the marker traits could nonetheless be manually implemented by third-parties. If that period is short, then the complexity of navigating it probably isn't justified.</p>



<a name="203743651"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/203743651" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Wrenn <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#203743651">(Jul 13 2020 at 17:25)</a>:</h4>
<p>I'll give a draft of the document without strict multi-staged rollout a shot!</p>



<a name="203744114"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/203744114" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Wrenn <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#203744114">(Jul 13 2020 at 17:28)</a>:</h4>
<p>Although I'll be <em>very</em> sorry to have to remove this example from the RFC:</p>
<div class="codehilite"><pre><span></span><code><span class="sd">/// A intelligent mammalian species of the genus Sus.</span>
<span class="k">enum</span> <span class="nc">Pig</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>

<span class="sd">/// Things that propel themselves through the air.</span>
<span class="k">trait</span><span class="w"> </span><span class="n">Flying</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>

<span class="sd">/// An initial, vacuous implementation of `TransmuteFrom`.</span>
<span class="k">impl</span><span class="o">&lt;</span><span class="n">Src</span><span class="p">,</span><span class="w"> </span><span class="n">Dst</span><span class="p">,</span><span class="w"> </span><span class="n">Options</span><span class="o">&gt;</span><span class="w"> </span><span class="n">TransmuteFrom</span><span class="o">&lt;</span><span class="n">Src</span><span class="p">,</span><span class="w"> </span><span class="n">Options</span><span class="o">&gt;</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">Dst</span><span class="w"></span>
<span class="k">where</span><span class="w"></span>
<span class="w">    </span><span class="n">Options</span>: <span class="nc">UnsafeTransmuteOptions</span><span class="p">,</span><span class="w"></span>
<span class="w">    </span><span class="n">Pig</span>: <span class="nc">Flying</span><span class="p">,</span><span class="w"></span>
<span class="p">{}</span><span class="w"></span>
</code></pre></div>



<a name="203745573"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/203745573" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#203745573">(Jul 13 2020 at 17:40)</a>:</h4>
<p>hahaha</p>



<a name="203776748"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/203776748" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Wrenn <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#203776748">(Jul 13 2020 at 21:57)</a>:</h4>
<p>Following up on ABIs &amp; transmuting function pointers, I found this (horrifying) article about type punning function pointers in C: <a href="https://www.evanmiller.org/type-punning-functions-in-c.html">https://www.evanmiller.org/type-punning-functions-in-c.html</a></p>



<a name="203776844"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/203776844" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Wrenn <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#203776844">(Jul 13 2020 at 21:58)</a>:</h4>
<p>I'll try to resist the urge to list that as a "Future Possibility" ;)</p>
<p>(The API <em>is</em> expressive enough that it could eventually support that case, though!)</p>



<a name="203782911"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/203782911" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#203782911">(Jul 13 2020 at 23:17)</a>:</h4>
<p>yeah, ABI might affect standard references/pointers too? I don't know enough about ABI details there really.</p>



<a name="203967777"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/203967777" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#203967777">(Jul 15 2020 at 15:10)</a>:</h4>
<p><span class="user-mention" data-user-id="219211">@Jack Wrenn</span> I'm curious why TransmuteInto and TransmuteFrom don't have constraints on Src and Dst.</p>



<a name="203967974"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/203967974" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#203967974">(Jul 15 2020 at 15:12)</a>:</h4>
<p>Also I'm confused why each of the methods for those traits repeat the where clause</p>



<a name="203968201"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/203968201" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#203968201">(Jul 15 2020 at 15:13)</a>:</h4>
<p>Lastly the RFC as written (at least at the beginning) seems to indicate that users must manually implement TransmuteInto and TransmuteFrom for all type combinations they wish to be able to transmute between.</p>



<a name="203968324"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/203968324" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Wrenn <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#203968324">(Jul 15 2020 at 15:14)</a>:</h4>
<p>I should clarify this, then: TransmuteFrom is only implemented, in the compiler, for Src and Dst for which the transmute is valid.</p>



<a name="203968434"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/203968434" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#203968434">(Jul 15 2020 at 15:15)</a>:</h4>
<p>Yea, I think that definitely should be mentioned at the beginning of that section. It's somewhat clear later on the in the RFC, but definitely not clear initially</p>



<a name="203970125"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/203970125" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#203970125">(Jul 15 2020 at 15:26)</a>:</h4>
<p>I also don't believe Unsafe vs SafeTransmute Options are explained.</p>



<a name="203989299"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/203989299" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Wrenn <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#203989299">(Jul 15 2020 at 17:51)</a>:</h4>
<p>Noted. Btw, I'm also still working on smoothing out the details of the stability marker traits!</p>



<a name="205640318"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/205640318" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Wrenn <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#205640318">(Jul 31 2020 at 20:51)</a>:</h4>
<p>Well, shit... <span aria-label="rolling on the floor laughing" class="emoji emoji-1f923" role="img" title="rolling on the floor laughing">:rolling_on_the_floor_laughing:</span> <br>
<a href="/user_uploads/4715/8R4fLD-gbCozgbSO7vBlJuIi/screenshot-hackmd.io-2020.07.31-16_48_50-1.png">the-limit.png</a></p>
<div class="message_inline_image"><a href="/user_uploads/4715/8R4fLD-gbCozgbSO7vBlJuIi/screenshot-hackmd.io-2020.07.31-16_48_50-1.png" title="the-limit.png"><img src="/user_uploads/4715/8R4fLD-gbCozgbSO7vBlJuIi/screenshot-hackmd.io-2020.07.31-16_48_50-1.png"></a></div>



<a name="205642505"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/205642505" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#205642505">(Jul 31 2020 at 21:16)</a>:</h4>
<p>bit of a bad sign</p>



<a name="205642647"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/205642647" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Wrenn <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#205642647">(Jul 31 2020 at 21:18)</a>:</h4>
<p>It's no biggie. I had a bunch of notes in there I hadn't deleted. The RFC goes <em>way</em> overboard on <em>Motivation</em>, <em>Case Studies</em>, <em>Prior Work</em> and <em>Future Possibilities</em>, too.</p>



<a name="205643077"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/205643077" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Wrenn <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#205643077">(Jul 31 2020 at 21:23)</a>:</h4>
<p>Anyways, I think I just finished the first draft! If you'd like to read it, here's the link: <a href="https://hackmd.io/@jswrenn/BJ5L7U9A8">https://hackmd.io/@jswrenn/BJ5L7U9A8</a></p>
<p>(There're a few minor TODOs, but they're inconsequential.)</p>



<a name="205748708"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/205748708" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Wrenn <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#205748708">(Aug 02 2020 at 23:31)</a>:</h4>
<p><strong><em>From now on, the authoritative draft of the RFC will be here:</em></strong> <a href="https://github.com/jswrenn/rfcs/blob/safe-transmute/text/0000-safe-transmute.md">https://github.com/jswrenn/rfcs/blob/safe-transmute/text/0000-safe-transmute.md</a></p>



<a name="205773958"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/205773958" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#205773958">(Aug 03 2020 at 09:18)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> can you make me and <span class="user-mention" data-user-id="219211">@Jack Wrenn</span> collaborators on the Safe Transmute <a href="https://github.com/rust-lang/project-safe-transmute">repo</a> so that we can add the RFC there.</p>



<a name="205800741"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/205800741" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#205800741">(Aug 03 2020 at 14:31)</a>:</h4>
<p><span class="user-mention" data-user-id="219211">@Jack Wrenn</span> with the draft not as an issue or PR it's hard to leave comments. How do you want to handle feedback?</p>



<a name="205801115"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/205801115" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Wrenn <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#205801115">(Aug 03 2020 at 14:34)</a>:</h4>
<p>Hm, I'm not completely sure. I could make a PR on the safe-transmute repo and comments could be made on the PR.</p>
<p>Or commenters could be directed to file an issue on the repo itself.</p>



<a name="205801298"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/205801298" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#205801298">(Aug 03 2020 at 14:36)</a>:</h4>
<p>PR sounds like the most natural given commenting abilities in GitHub. We'd merge when we're ready to publish it to another platform (either internals or the RFCs repo)</p>



<a name="205801324"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/205801324" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Wrenn <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#205801324">(Aug 03 2020 at 14:36)</a>:</h4>
<p>Sounds good!</p>



<a name="205801514"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/205801514" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#205801514">(Aug 03 2020 at 14:38)</a>:</h4>
<p><span class="user-mention" data-user-id="224872">@Ryan Levick</span> ok</p>



<a name="205802733"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/205802733" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#205802733">(Aug 03 2020 at 14:49)</a>:</h4>
<p><span class="user-mention" data-user-id="219211">@Jack Wrenn</span> remind me your github id</p>



<a name="205802793"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/205802793" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Wrenn <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#205802793">(Aug 03 2020 at 14:50)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> jswrenn</p>



<a name="205809803"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/205809803" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Wrenn <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#205809803">(Aug 03 2020 at 15:41)</a>:</h4>
<p><strong><em>Authoritative draft of the RFC is now here:</em></strong> <a href="https://github.com/rust-lang/project-safe-transmute/pull/5">https://github.com/rust-lang/project-safe-transmute/pull/5</a></p>



<a name="206822717"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/206822717" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#206822717">(Aug 13 2020 at 14:39)</a>:</h4>
<p>FYI: I posted the a link to the draft on an issue which the lang team will review at their next meeting. Hopefully we get more feedback through that.</p>



<a name="206822854"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/206822854" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#206822854">(Aug 13 2020 at 14:40)</a>:</h4>
<p><a href="https://github.com/rust-lang/lang-team/issues/21">https://github.com/rust-lang/lang-team/issues/21</a></p>



<a name="206913353"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/206913353" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#206913353">(Aug 14 2020 at 09:48)</a>:</h4>
<blockquote>
<p>In Zig the problem of alignment is solved completely;</p>
</blockquote>
<p>(since Zig has unsafe code, I doubt that -- with truly unsafe code you should be able to implement an unchecked cast function that you can use to cast around alignment annotations on the types. but the rest of the point quoted in the RFC remains valid.)</p>



<a name="206928621"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/206928621" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#206928621">(Aug 14 2020 at 13:26)</a>:</h4>
<p>but you <em>can</em> do that in Zig, it says as much in the example</p>



<a name="206929186"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/206929186" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#206929186">(Aug 14 2020 at 13:33)</a>:</h4>
<p>re: <strong>Platform Stability</strong> all integer types lack platform stability because of Endian difference</p>



<a name="206929231"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/206929231" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#206929231">(Aug 14 2020 at 13:33)</a>:</h4>
<p>I'm not even sure that Platform Stability is a particularly useful notion.</p>



<a name="206942403"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/206942403" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#206942403">(Aug 14 2020 at 15:37)</a>:</h4>
<p><span class="user-mention silent" data-user-id="224471">Lokathor</span> <a href="#narrow/stream/216762-project-safe-transmute/topic/RFC.20Proposal/near/206928621">said</a>:</p>
<blockquote>
<p>but you <em>can</em> do that in Zig, it says as much in the example</p>
</blockquote>
<p>but then the problem of alignments isnt solved, at least in the sense that you can still break alignment guarantees</p>



<a name="206942478"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/206942478" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Wrenn <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#206942478">(Aug 14 2020 at 15:37)</a>:</h4>
<p>I think it's solved in the sense that you have to explicitly opt-out of alignment safety.</p>



<a name="206942538"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/206942538" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#206942538">(Aug 14 2020 at 15:38)</a>:</h4>
<p>sure. same in Rust. you have to say <code>unsafe</code>.</p>



<a name="206942668"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/206942668" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#206942668">(Aug 14 2020 at 15:39)</a>:</h4>
<p>once you go unsafe, neither language can fully protect you.</p>
<p>I guess I just disagree with that use of the term "solved". I don't think there is a binary solved/unsolved for this once you go unsafe. but zig makes it harder to make these mistakes.</p>



<a name="206942675"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/206942675" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Wrenn <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#206942675">(Aug 14 2020 at 15:39)</a>:</h4>
<p>Not quite. <code>unsafe</code> doesn't communicate why the thing you're doing is unsafe. As Kelley's article points out: your code might be unsafe in ways you're unaware of.</p>



<a name="206942849"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/206942849" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#206942849">(Aug 14 2020 at 15:40)</a>:</h4>
<p>sure. and if zig has unchecked transmutes, or raw pointers, or unchecked unions, it has the same problem.</p>



<a name="206942964"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/206942964" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#206942964">(Aug 14 2020 at 15:41)</a>:</h4>
<p>once you go unsafe, this isn't black or white. it's many shades of gray. "problem solved" pretends otherwise, and that is all I am disagreeing with here.</p>



<a name="206943061"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/206943061" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Wrenn <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#206943061">(Aug 14 2020 at 15:42)</a>:</h4>
<p>I agree with that. Had I written that article, I don't think I would have used such strong language.</p>



<a name="206947407"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/206947407" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Wrenn <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#206947407">(Aug 14 2020 at 16:19)</a>:</h4>
<p><span class="user-mention silent" data-user-id="224471">Lokathor</span> <a href="#narrow/stream/216762-project-safe-transmute/topic/RFC.20Proposal/near/206929186">said</a>:</p>
<blockquote>
<p>re: <strong>Platform Stability</strong> all integer types lack platform stability because of Endian difference</p>
</blockquote>
<p>Endian differences do not <em>usually</em> affect transmutability, which is why I don't go into it. Of course, an RFC that <em>did</em> propose a notion of platform stability certainly would need to.</p>



<a name="206966137"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/206966137" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#206966137">(Aug 14 2020 at 19:10)</a>:</h4>
<p>Ah, I misunderstood what "no notion of platform stability" meant.</p>
<p>I thought it was saying "we won't transmute these things", but I guess the intent is "we will transmute these things and results may vary"</p>



<a name="206967268"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/206967268" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Wrenn <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#206967268">(Aug 14 2020 at 19:21)</a>:</h4>
<p>Yeah, the original wording of the section wasn't clear. Since your first read of the Platform Stability section, I <a href="https://github.com/rust-lang/project-safe-transmute/pull/5/commits/f85600d03f650c419abb849ee8d3db468ad9931c">revised</a> it to say:</p>
<blockquote>
<p>Our proposed stability system is oblivious to the inter-platform variations of these types.</p>
</blockquote>
<p>I hope that's an improvement.</p>



<a name="207472214"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/207472214" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Wrenn <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#207472214">(Aug 19 2020 at 23:10)</a>:</h4>
<p><span class="user-mention" data-user-id="224872">@Ryan Levick</span>, <span class="user-mention" data-user-id="132362">@Joshua Liebow-Feeser</span>, I made an <strong><a href="https://internals.rust-lang.org/t/pre-rfc-safer-transmutation/12926">internals post</a></strong>!</p>



<a name="207481755"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/207481755" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#207481755">(Aug 20 2020 at 01:57)</a>:</h4>
<p><span class="user-mention" data-user-id="219211">@Jack Wrenn</span> you might want to have some more examples, specifically on the <code>safe_transmute</code> and <code>unsafe_transmute</code> functions themselves. The "options" system, while a marvel, makes things less clear to someone who's first approaching the API. What options do I need? When do I need them? If I don't add any options and get an error, should I add an option or should I stop attempting what I'm trying to attempt? That sort of stuff.</p>



<a name="207481767"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/207481767" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Wrenn <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#207481767">(Aug 20 2020 at 01:58)</a>:</h4>
<p>Good idea! Will do first thing tomorrow!</p>



<a name="207481903"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/207481903" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#207481903">(Aug 20 2020 at 02:00)</a>:</h4>
<p>My suspicion though is that I'll be able to fairly simply make <code>bytemuck-2.0.0</code> that almost immediately delegates to these methods without changing the outer API other than a few trait bounds.</p>
<p>In that sense, you've got a success on your hands, because the absolute simplicity of <code>bytemuck</code> is why it's as popular as it is.</p>



<a name="207481943"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/207481943" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Wrenn <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#207481943">(Aug 20 2020 at 02:01)</a>:</h4>
<p>That's my hope!</p>



<a name="207495140"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/207495140" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#207495140">(Aug 20 2020 at 07:17)</a>:</h4>
<p>I’m excited to see what the wider community says! Let’s discuss how the feedback is going next week and see when we want to post to the rfcs repo</p>



<a name="207992413"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/207992413" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#207992413">(Aug 25 2020 at 17:19)</a>:</h4>
<p><span class="user-mention" data-user-id="219211">@Jack Wrenn</span> the feedback on the internals post is pretty slow. Do we have an idea of what next steps are?</p>



<a name="207994896"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/207994896" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Wrenn <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#207994896">(Aug 25 2020 at 17:36)</a>:</h4>
<p>Hm. I'm not sure. A reddit post might draw additional feedback, as well as a TWiR mention.</p>



<a name="207995370"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/207995370" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Wrenn <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#207995370">(Aug 25 2020 at 17:40)</a>:</h4>
<p>The round of feedback we did receive was helpful, since it made me confirm that vec casting is possible out-of-the-box, and slice-casting is possible without the const-generics extension I had previously thought would be required. </p>
<p>So: I have a bit of writing to do. I need to update the slice-casting extension, and add a section on type-gadgets.</p>



<a name="208003502"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/208003502" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#208003502">(Aug 25 2020 at 18:34)</a>:</h4>
<p><span class="user-mention" data-user-id="219211">@Jack Wrenn</span> I can post to reddit. Have we heard any feedback from the lang team? We may have to post the actual RFC before we get any real feedback</p>



<a name="208004012"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/208004012" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Wrenn <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#208004012">(Aug 25 2020 at 18:37)</a>:</h4>
<p>I don't know if we've received feedback from the lang team, yet. (<span class="user-mention" data-user-id="239881">@Josh Triplett</span>, did you ever get a chance to read it?)</p>



<a name="208033126"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/208033126" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Wrenn <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#208033126">(Aug 25 2020 at 22:39)</a>:</h4>
<p><strong>Minor Victory!</strong> Previously, a few of this crate's proposed extensions (namely slice casting and <code>FromBytes</code>/<code>IntoBytes</code>) required a speculative advancement in const-generics: namely, writing types of the form <code>[U; size_of::&lt;T&gt;()]</code> in <code>where</code> bounds.</p>
<p>That's no longer the case!</p>
<ul>
<li>For <a href="https://github.com/jswrenn/project-safe-transmute/blob/rfc/rfcs/0000-safe-transmute.md#slice-casting">slice casting</a>, I had erroneously believed that it was not possible to even mention types above the object-size limit. That's not the case! We can construct (as a type) a sufficiently large array as <code>[Src; usize::MAX]</code>, even if the size of <code>Src</code> is greater than 1.</li>
<li>For <a href="https://github.com/jswrenn/project-safe-transmute/blob/rfc/rfcs/0000-safe-transmute.md#extension-byte-transmutation-traits"><code>FromBytes</code>/<code>IntoBytes</code></a> I had thought I needed to construct equivalently-sized arrays of bytes (e.g., <code>[u8; size_of::&lt;Src&gt;()]</code>). Not so! We can <a href="https://github.com/jswrenn/project-safe-transmute/blob/rfc/rfcs/0000-safe-transmute.md#removing-the-dependency-on-const-generics">exploit the same <code>[T; usize::MAX]</code> trick</a>.</li>
</ul>
<p>The RFC's extensions are now <em>truly</em> extensions of <em>just</em> the RFC's mechanisms!</p>



<a name="208082838"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/208082838" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#208082838">(Aug 26 2020 at 12:10)</a>:</h4>
<p>I <strong>love</strong> the gadgets extension. This captures the composability and the usability of mem markers with the flexibility and correctness of typic. It's the best of both worlds. Really great work <span class="user-mention" data-user-id="219211">@Jack Wrenn</span> !</p>



<a name="208091012"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/208091012" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#208091012">(Aug 26 2020 at 13:34)</a>:</h4>
<p>the RFC is just... way too long at this point :/</p>



<a name="208091316"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/208091316" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#208091316">(Aug 26 2020 at 13:37)</a>:</h4>
<p>I think that lot of the "oh look what you could eventually do with this!" stuff should probably be pulled out and put in blog posts or something like that.</p>



<a name="208099240"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/208099240" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Wrenn <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#208099240">(Aug 26 2020 at 14:33)</a>:</h4>
<p>I agree about the length. If this was an mdbook, it might not be so bad, but it's not—it's a <em>long</em> linear document with no navigation support.</p>



<a name="208099593"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/208099593" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#208099593">(Aug 26 2020 at 14:36)</a>:</h4>
<p>I still think the document overall would be stronger if the supporting use cases, extensions, and possibilities sections were in another document linked to the RFC.</p>



<a name="208114501"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/208114501" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#208114501">(Aug 26 2020 at 16:24)</a>:</h4>
<p>This proposal does seem like... a lot</p>



<a name="208114550"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/208114550" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#208114550">(Aug 26 2020 at 16:24)</a>:</h4>
<p>I think this could easily be the most complicated API in the whole standard library</p>



<a name="208115396"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/208115396" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Wrenn <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#208115396">(Aug 26 2020 at 16:32)</a>:</h4>
<p>Without a doubt. The API surface is relatively simple, but its consequences and implementation are not.</p>
<p>Since the bar for compiler-supported traits should be <em>very</em> high, a great deal of this RFC's length is expended on:</p>
<ul>
<li>demonstrating that the novel mechanisms are sound (namely its notion of safety and its formulation of stability)</li>
<li>demonstrating that the implementation does not need to be all-or-nothing, and can gradually increase in complexity</li>
<li>demonstrating that the burden of the proposal is justified: its API surface comprehensively covers virtually all known use-cases</li>
</ul>



<a name="208185079"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/208185079" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#208185079">(Aug 27 2020 at 07:23)</a>:</h4>
<p>Is there a way to stage this, to first propose some "MVP" style API?<br>
I'd love to give feedback, but giving feedback on such a huge document is a daunting task.</p>



<a name="208193715"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/208193715" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#208193715">(Aug 27 2020 at 09:15)</a>:</h4>
<p>/me sees things like <code>Neglect*</code> and feels like this is way beyond an MCP.^^</p>



<a name="208203402"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/208203402" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Wrenn <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#208203402">(Aug 27 2020 at 11:18)</a>:</h4>
<p>This is a staged proposal, but that ultimately makes the document longer because designing staged proposals that don't accidentally close important doors is tricky.</p>
<p>The Neglect parameter is one such easily-closed door. Most of the various possible options are eventually very useful to have, but not actually necessary for an MVP. Just one option needs to be in the MVP: NeglectStability, and the RFC describes how a simplistic version of it can be initially used with some minor drawbacks.</p>



<a name="208203681"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/208203681" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#208203681">(Aug 27 2020 at 11:22)</a>:</h4>
<p>Correct me if I'm wrong but the proposal does have an MVP API. I think perhaps we can more clearly label it as such? It seems that there's still confusion that everything in the document has to be agreed upon today when in fact the extensions and such are there to show that the API can grow to meet all the needs we would one day hope for it to.</p>



<a name="208203723"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/208203723" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Wrenn <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#208203723">(Aug 27 2020 at 11:22)</a>:</h4>
<p>Yes, that's true—I wasn't even thinking of the extensions. I'm currently working on factoring those out into separate documents.</p>



<a name="208204147"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/208204147" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#208204147">(Aug 27 2020 at 11:27)</a>:</h4>
<p>Even still I think perhaps retitle <a href="https://github.com/jswrenn/project-safe-transmute/blob/rfc/rfcs/0000-safe-transmute.md#listing-for-initial-minimal-implementation">this section</a> and making it abundantly clear what you hope to achieve with the RFC - i.e., we want to set a "north star" of what we hope this proposal will ultimately grow into, we hope to convince everyone that the proposal can grow into the north start, and we want to propose a minimal version that we want to implement now. People should agree that the "north star" in general is a good place to aim for even if the details aren't perfect, and they should agree that the minimal implementation is truly minimal and helpful to get us on a path to the north star.</p>



<a name="208277586"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/208277586" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Wrenn <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#208277586">(Aug 27 2020 at 21:17)</a>:</h4>
<p>I've moved the case studies and extensions to companion documents.</p>



<a name="208370156"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/208370156" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#208370156">(Aug 28 2020 at 17:09)</a>:</h4>
<p>ah, when I said MVP I was thinking of a self-contained document describing only that MVP. that would help reviewing. :)</p>



<a name="208370488"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/208370488" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Wrenn <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#208370488">(Aug 28 2020 at 17:13)</a>:</h4>
<p>I'll try to whip something up.</p>



<a name="208387809"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/208387809" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Wrenn <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#208387809">(Aug 28 2020 at 19:50)</a>:</h4>
<p><span class="user-mention" data-user-id="120791">@RalfJ</span>, here's a sorta TL;DR of the RFC: <a href="https://hackmd.io/@jswrenn/H1ytdaI7w">https://hackmd.io/@jswrenn/H1ytdaI7w</a></p>



<a name="208387855"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/208387855" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Wrenn <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#208387855">(Aug 28 2020 at 19:51)</a>:</h4>
<p>I'm having a really hard time distilling it down further than that. <span aria-label="sad" class="emoji emoji-2639" role="img" title="sad">:sad:</span></p>



<a name="208391246"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/208391246" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> jknodt <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#208391246">(Aug 28 2020 at 20:25)</a>:</h4>
<p>(deleted)</p>



<a name="208395517"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/208395517" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Wrenn <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#208395517">(Aug 28 2020 at 21:12)</a>:</h4>
<p><span class="user-mention" data-user-id="326189">@jknodt</span> This is a fine place for more-synchronous discussions! Let me know if I've <a href="https://github.com/rust-lang/project-safe-transmute/pull/5#issuecomment-683147373">resolved</a> your question. I think the answer to it is a major missing piece from the <em>Rationale</em> section.</p>



<a name="208402581"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/208402581" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Wrenn <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#208402581">(Aug 28 2020 at 22:43)</a>:</h4>
<p>I've removed the 'Dissecting Stability' and 'Uncommon Use-Case: Weak Stability Guarantees' sections. If anyone has objections, please let me know.</p>
<p>I think it's likely that these sections are answering questions that nobody is asking, or which would be better answered in a blog post.</p>



<a name="208552495"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/208552495" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#208552495">(Aug 31 2020 at 12:56)</a>:</h4>
<p><span class="user-mention" data-user-id="219211">@Jack Wrenn</span> the RFC is really shapping up and has gotten some good feedback. We've still not heard from the lang and compiler teams I believe. We could try again to get their attention again (ping <span class="user-mention" data-user-id="239881">@Josh Triplett</span> and <span class="user-mention" data-user-id="116009">@nikomatsakis</span> ) or we can just post the RFC. Thoughts?</p>



<a name="208554328"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/208554328" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Wrenn <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#208554328">(Aug 31 2020 at 13:12)</a>:</h4>
<p>I'd like some feedback from a team member before posting, to ensure we're not missing anything essential.  For instance, does the transmutaibility algorithm need to be formally described?</p>
<p>I also have some illustration ideas for stability that might help some readers visualize how it works. :)</p>



<a name="208586944"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/208586944" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pachi <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#208586944">(Aug 31 2020 at 17:02)</a>:</h4>
<p>I'm not a project member but, well, the RFC process is just for that, and some people in the relevant teams may (wrongly) think that the RFC is not ready for comments. From what I've seen and what you expect now I humbly think that you should just post the RFC to signal the relevant team members (and other community members) that it's ready to have a look to it and comment.</p>



<a name="208587030"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/208587030" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pachi <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#208587030">(Aug 31 2020 at 17:03)</a>:</h4>
<p>Many people may inhibit from commenting if they think it's still too much a work in progress, while it looks like it's in a state that it mainly needs further feedback (IMHO).</p>



<a name="208589067"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/208589067" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#208589067">(Aug 31 2020 at 17:23)</a>:</h4>
<p>While I think this is a good point in general, we've already explicitly asked the lang and compiler teams for feedback so they should be aware that the proposal is ready for it.</p>



<a name="208595623"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/208595623" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#208595623">(Aug 31 2020 at 18:19)</a>:</h4>
<p>/me apologizes for not having the bandwidth to review right this second.</p>



<a name="208595647"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/208595647" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#208595647">(Aug 31 2020 at 18:19)</a>:</h4>
<p><span class="user-mention" data-user-id="224872">@Ryan Levick</span> Currently in the midst of several things, one of which you already know about, that are taking priority. :)</p>



<a name="208595670"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/208595670" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#208595670">(Aug 31 2020 at 18:19)</a>:</h4>
<p>/me reads the summary.</p>



<a name="208595882"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/208595882" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#208595882">(Aug 31 2020 at 18:21)</a>:</h4>
<p>Some questions as I go...</p>



<a name="208595975"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/208595975" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#208595975">(Aug 31 2020 at 18:22)</a>:</h4>
<p>TransmuteFrom requires both types be Sized. Will it be possible to safely transmute slices and other unsized things?</p>



<a name="208596115"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/208596115" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#208596115">(Aug 31 2020 at 18:23)</a>:</h4>
<p>I suspect the name <code>Neglect</code> will get bikeshedding, but I'm not going to do that here and now.</p>



<a name="208596380"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/208596380" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Wrenn <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#208596380">(Aug 31 2020 at 18:25)</a>:</h4>
<p><span class="user-mention silent" data-user-id="239881">Josh Triplett</span> <a href="#narrow/stream/216762-project-safe-transmute/topic/RFC.20Proposal/near/208595975">said</a>:</p>
<blockquote>
<p>TransmuteFrom requires both types be Sized. Will it be possible to safely transmute slices and other unsized things?</p>
</blockquote>
<p>Not directly. However, the API is expressive enough to be a sound and complete foundation for transmutation-like conversions of slices and vecs without further compiler support. <a href="https://github.com/jswrenn/project-safe-transmute/blob/rfc/rfcs/0000-ext-container-casting.md">See here for a demonstration.</a></p>



<a name="208596504"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/208596504" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#208596504">(Aug 31 2020 at 18:26)</a>:</h4>
<p>That makes sense; so, the element type must be Sized but the container might not need to be?</p>



<a name="208596541"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/208596541" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#208596541">(Aug 31 2020 at 18:26)</a>:</h4>
<p>That won't cover, long-term, things like variable-length structures, but it'll cover lots of cases.</p>



<a name="208596653"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/208596653" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#208596653">(Aug 31 2020 at 18:27)</a>:</h4>
<p>The initial proposal doesn't have to cover this, but long-term, do you have a plan for handling things like variable-length structures with a common header that includes length and type? Or is that just out of scope?</p>



<a name="208596682"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/208596682" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#208596682">(Aug 31 2020 at 18:27)</a>:</h4>
<p>(I'm thinking of things like ACPI here.)</p>



<a name="208596870"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/208596870" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#208596870">(Aug 31 2020 at 18:28)</a>:</h4>
<p>I'm reading the bits about UdpPacket and UdpHeader, and wondering whether it'd be possible to automate more of that and whether that automation would require compiler help.</p>



<a name="208596895"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/208596895" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Wrenn <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#208596895">(Aug 31 2020 at 18:29)</a>:</h4>
<p>The actual <code>TransmuteFrom</code> trait specifies that its parameters are <code>?Sized</code>, so the API could grow to support unsized use-cases.</p>
<p>For now, I haven't been thinking of slice conversions as <em>transmutations</em>, per se. The layout of slices is unspecified, and actual transmutation of slices isn't a very common use case. Typically, you want to "transmute" the <em>contents</em> of the slice, and adjust its length accordingly. Because the length needs adjusting, it's not a simple bit-reinterpretation.</p>



<a name="208597008"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/208597008" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#208597008">(Aug 31 2020 at 18:29)</a>:</h4>
<p>/me is slightly confused.</p>



<a name="208597116"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/208597116" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#208597116">(Aug 31 2020 at 18:30)</a>:</h4>
<p><span class="user-mention" data-user-id="219211">@Jack Wrenn</span> The summary doc at <a href="https://hackmd.io/@jswrenn/H1ytdaI7w">https://hackmd.io/@jswrenn/H1ytdaI7w</a> has <code>Src: Sized, Self: Sized,</code></p>



<a name="208597207"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/208597207" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Wrenn <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#208597207">(Aug 31 2020 at 18:31)</a>:</h4>
<p>On the <em>methods</em>, not the trait itself. (Needed because methods are currently constrained in that they must consume and produce <code>Sized</code> types.)</p>



<a name="208597239"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/208597239" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#208597239">(Aug 31 2020 at 18:31)</a>:</h4>
<p>Ah, I see.</p>



<a name="208597263"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/208597263" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#208597263">(Aug 31 2020 at 18:31)</a>:</h4>
<p>So the idea would be that the trait would provide the necessary guarantees, and we could add methods in the future that don't require Sized?</p>



<a name="208597324"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/208597324" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#208597324">(Aug 31 2020 at 18:31)</a>:</h4>
<p>That makes sense.</p>



<a name="208597511"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/208597511" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#208597511">(Aug 31 2020 at 18:33)</a>:</h4>
<p>Regarding the example in the summary of the main RFC...</p>



<a name="208597580"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/208597580" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#208597580">(Aug 31 2020 at 18:33)</a>:</h4>
<p>Does it seem feasible to teach the compiler to understand <code>TransmuteInto</code> and <code>TransmuteFrom</code> enough that the error you're showing could be extended to explain <em>why</em> it can't transmute (in this case, because of the padding byte)?</p>



<a name="208597680"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/208597680" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#208597680">(Aug 31 2020 at 18:34)</a>:</h4>
<p>It'd be amazing to have the compiler tell you, as plainly as possible, "I can't transmute <code>Foo</code> to <code>u32</code> because <code>Foo</code> has a padding byte after field 0, at this offset, because of the alignment of field 1, see $URL for why that's not safe".</p>



<a name="208598187"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/208598187" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Wrenn <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#208598187">(Aug 31 2020 at 18:37)</a>:</h4>
<p>Yes, it's <em>very</em> feasible! The displayed error message is what you would get <em>right now</em> if <code>TransmuteFrom</code> lacked any special error reporting.</p>



<a name="208598324"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/208598324" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Wrenn <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#208598324">(Aug 31 2020 at 18:38)</a>:</h4>
<p>Better error reporting basically boils down having the implementation of <code>TransmuteFrom</code> keep track of the byte offset it's looking at as it traverses the layouts of the source and destination types.</p>



<a name="208601156"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/208601156" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#208601156">(Aug 31 2020 at 19:00)</a>:</h4>
<p>Looking through the rest of the RFC, this looks <em>great</em>, and I think it's ready.</p>



<a name="208601172"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/208601172" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#208601172">(Aug 31 2020 at 19:00)</a>:</h4>
<p>I think this is ready to pitch to the lang team.</p>



<a name="208601287"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/208601287" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#208601287">(Aug 31 2020 at 19:01)</a>:</h4>
<p>This is incredibly thorough.</p>



<a name="208603979"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/208603979" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#208603979">(Aug 31 2020 at 19:25)</a>:</h4>
<p>We just discussed project-safe-transmute briefly in the lang team meeting. Summary: please go ahead and open the RFC, and we'll review.</p>



<a name="208604085"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/208604085" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#208604085">(Aug 31 2020 at 19:26)</a>:</h4>
<p>I said, for the record, that the RFC was almost tutorial-esque, and that it's readable without any past background on safe-transmute.</p>



<a name="208606520"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/208606520" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#208606520">(Aug 31 2020 at 19:46)</a>:</h4>
<p><span class="user-mention" data-user-id="219211">@Jack Wrenn</span> let me know if/how I can help. Very excited to see this go to the next stage. Thanks for all your amazing work!</p>



<a name="208631095"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/208631095" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Wrenn <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#208631095">(Sep 01 2020 at 00:05)</a>:</h4>
<p><strong><em>RFC Submitted!</em></strong> <a href="https://github.com/rust-lang/rfcs/pull/2981">https://github.com/rust-lang/rfcs/pull/2981</a></p>



<a name="209220675"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/216762-project-safe-transmute/topic/RFC%20Proposal/near/209220675" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/216762-project-safe-transmute/topic/RFC.20Proposal.html#209220675">(Sep 06 2020 at 11:13)</a>:</h4>
<p>Great work <span class="user-mention" data-user-id="219211">@Jack Wrenn</span>! This is probably the most thoroughly explored and explained RFC I read so far, and it does a great job throughout. While reading it, I found myself nodding in agreement basically all the time. I am sure there are kinks to solve, but I am confident that this this attitude and attention to detail, you will not compromise on correctness and the result will be great. :)</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>